    #include <iostream>
    #include <string>
    #include <stdio.h>
    #include <stdlib.h>
    #include "opencv2/opencv.hpp"
    using namespace cv;
    using namespace std;
    int main(int argc, char**argv)
    {
        Mat frame;
        int i=0,j=0;
        //VideoCapture cap("http://admin:12345@192.168.3.33:8081/?action=stream");
VideoCapture cap("rtsp://admin:12345@192.168.3.3:8554/live");
        char filename[256];
        while (1)
        {
            i++;
            cap >> frame;
	if(i%30==0&&i<50)
	{
		j++;
		sprintf(filename, "/home/dat/test/img/%06d.jpg", j);
		imwrite(filename, frame);
	}

		imshow("test",frame);
		waitKey(1);
        }
        return 0;
    }